1. Field of the Invention
The present invention relates to a method and apparatus for reading data in a distributed file system in which a client and a server are separated, and more particularly, to a method and apparatus for performing a prefetching operation to provide a continuous read function with high performance even in a distributed file system so that an optimum continuous read function of a local file system within the client may be effectively supported when an application program of the client requests continuous reading on a file (or chunk).
2. Discussion of Related Art
In general, a file system performs prefetching to effectively process continuous file reading of an application program. The prefetching is a function of processing a read request of a user and continuous reading of the next block in preparation of the next continuous reading together. In the prefetching operation, the read request may be processed within a short response for the next reading. For this, the file system maintains a readahead window structure according to each open file. Within this structure, an offset which is information of a position at which a read operation has recently been requested in an application program and readahead size information are maintained.
The readahead operation of a local file system is different from that of the distributed file system. In the distributed file system, the server also needs to perform the readahead operation simultaneously when the readahead operation is performed in a client file system. Thus, the following problems may occur in the distributed file system.
1. Reordering
The execution order of a continuous readahead request occurring in the readahead operation of the client can be changed in a request processing unit of the server. Thus, a readahead window size of the local file system of the server is reduced and therefore efficiency of the readahead operation may be degraded.
2. Readahead Window Mismatch
Because the client and the server simultaneously perform the readahead operation in the distributed file system, continuous reading may be inefficiently performed when a readahead technique is different between the client and the server. For example, the above-described problem may occur when the readahead size of the client is greater or less than that of the server.